package com.cskaoyan.wxcontroller;


import com.cskaoyan.bean.baseresultVO.BaseRespVo;
import com.cskaoyan.bean.baseresultVO.WxResultListVo;
import com.cskaoyan.bean.domain.Comment;
import com.cskaoyan.bean.wxComment.CommentVo;
import com.cskaoyan.bean.wxComment.WxCountList;
import com.cskaoyan.service.WxCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author lirui
 * @Date 2021/12/2 17:02
 * @describe:
 */
@RestController
@RequestMapping("wx/comment")
public class WxCommentController {
    @Autowired
    WxCommentService wxCommentService;

    @RequestMapping("list")
    public BaseRespVo commentList(Integer valueId,Byte type,Integer limit,Integer page,Integer showType){
        WxResultListVo data=wxCommentService.queryCommentList(valueId,type,limit,page,showType);
        return BaseRespVo.ok(data);
    }
   @RequestMapping("count")
   public  BaseRespVo countList(Integer valueId,Integer type){
       WxCountList data=wxCommentService.queryCountList(valueId,type);
        return BaseRespVo.ok(data);

   }

    @RequestMapping("post")
    public BaseRespVo commentPost(@RequestBody Comment commentVo){
        Comment data=wxCommentService.addCommentPost(commentVo);
        return BaseRespVo.ok(data);

    }
    
    

}
